<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Foundry</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Foundry</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">This class is reponsible for building a site/application  based on desired sitemap and configuration settings.</p>
<p class="description"><p>The build process creates a compiled php file from the sitemap  definition as well as the necessary file to handle the logic of  presenting these files based on request.</p><p>A typical build would output: <ul><li>A loader file such as index.php which is used as the 'entrance' file for the application.</li><li>A switchbox file which is responsible for returning the proper data based on request</li><li>A number of 'gate' php files, one for each section or 'page' of the sitema which</li></ul> are responsible for handling the per request logic and will load the  necessary module files such as query definitions, php scripts, xsl stylesheets, <ul><li>A configuration file based on our preferences.</li></ul>  To build an application, you will need a script to call the Foundry process.  Here is some sample code:  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//load&nbsp;the&nbsp;application&nbsp;builder&nbsp;class</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-inc">require_once</span><span class="src-sym">(</span><span class="src-str">'/home/lotus/nexista/kernel/foundry.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//instanciate&nbsp;and&nbsp;initialize&nbsp;it&nbsp;with&nbsp;our&nbsp;desired&nbsp;registry&nbsp;file</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$foundry&nbsp;</span>=&nbsp;<span class="src-id"><a href="../Nexista/Foundry.html">Foundry</a></span><span class="src-sym">::</span><a href="../Nexista/Foundry.html#methodsingleton">singleton</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//load&nbsp;the&nbsp;master&nbsp;config,&nbsp;the&nbsp;user&nbsp;override&nbsp;config&nbsp;and&nbsp;process&nbsp;for&nbsp;'live'&nbsp;mode</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$foundry</span><span class="src-sym">-&gt;</span><a href="../Nexista/Foundry.html#methodconfigure">configure</a><span class="src-sym">(</span><span class="src-str">'./master.xml'</span><span class="src-sym">,</span><span class="src-str">'./user.xml'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'live'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//build&nbsp;loader&nbsp;(i.e.&nbsp;index.php)</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$foundry</span><span class="src-sym">-&gt;</span><a href="../Nexista/Foundry.html#methodbuildLoader">buildLoader</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//compile&nbsp;the&nbsp;application</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$foundry</span><span class="src-sym">-&gt;</span><a href="../Nexista/Foundry.html#methodbuildGates">buildGates</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$foundry</span><span class="src-sym">-&gt;</span><a href="../Nexista/Foundry.html#methodbuildSitemap">buildSitemap</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-php">?&gt;</span></div></li>
</ol></div></p></p>
	<ul class="tags">
				<li><span class="field">tutorial:</span> reference.pkg</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_kernel---foundry.php.html">/kernel/foundry.php</a> (line <span class="field">71</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																<div class="var-title">
					<span class="var-type">boolean</span>
					<a href="#$debug" title="details" class="var-name">$debug</a>
				</div>
																<div class="var-title">
					<span class="var-type">object</span>
					<a href="#$sitemapDocument" title="details" class="var-name">$sitemapDocument</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																				<div class="method-definition">
					static 						<span class="method-result">string</span>
										<a href="#singleton" title="details" class="method-name">singleton</a>
										()
									</div>
								
												<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#buildGates" title="details" class="method-name">buildGates</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#buildLoader" title="details" class="method-name">buildLoader</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#buildSitemap" title="details" class="method-name">buildSitemap</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#configure" title="details" class="method-name">configure</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$master</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$local</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$mode</span> = <span class="var-default">null</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$config_filename</span> = <span class="var-default">'config.xml'</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#defineEntities" title="details" class="method-name">defineEntities</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$master</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$mode</span> = <span class="var-default">NULL</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$config_filename</span> = <span class="var-default">'entities.xml'</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getCompilePath" title="details" class="method-name">getCompilePath</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getSitemapPath" title="details" class="method-name">getSitemapPath</a>
										()
									</div>
																</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$debug" id="$debug"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">boolean</span>
			<span class="var-name">$debug</span>
			 = <span class="var-default"> false</span>			(line <span class="line-number">115</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Print debug info when building</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$sitemapDocument" id="$sitemapDocument"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">object</span>
			<span class="var-name">$sitemapDocument</span>
						(line <span class="line-number">89</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sitemap root node object</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodsingleton" id="singleton"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">static method singleton</span> (line <span class="line-number">719</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns gate prepend code</p>
	<ul class="tags">
				<li><span class="field">return:</span> prepend code</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">string</span>
		<span class="method-name">
			singleton
		</span>
				()
			</div>
	
		
			
	</div>

<a name="methodbuildGates" id="buildGates"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">buildGates</span> (line <span class="line-number">326</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Parses the sitemap, calling build process for each gate</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			buildGates
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodbuildLoader" id="buildLoader"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">buildLoader</span> (line <span class="line-number">223</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Builds the loader file (i.e. index.php)</p>
<p class="description"><p>This method creates a loader file based on config settings.  This file is used as the 'entrance' file for the site, loading the  sitemap and appropriate gate file.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> success of writing loader file</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			buildLoader
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodbuildSitemap" id="buildSitemap"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">buildSitemap</span> (line <span class="line-number">434</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Compiles the final sitemap file</p>
<p class="description"><p>This method takes $this-&gt;sitemap array which  contains all the gate info and builds an if/else  condition map out of it. This file will be used  as the sitemap for the site</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			buildSitemap
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodconfigure" id="configure"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">configure</span> (line <span class="line-number">133</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Read and writes the application config data</p>
<p class="description"><p>This method loads the config data that holds the applciation  parameters such as paths, location of sitemap,  session preferences, db connections, etc...  Some of this data will be written directly in the gate files  during the compile process. It takes the config xml and ouputs  it as combnined xml file for runtime.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			configure
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$master</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$local</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$mode</span> = <span class="var-default">null</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$config_filename</span> = <span class="var-default">'config.xml'</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$master</span><span class="var-description">: master config file</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$local</span><span class="var-description">: optional local override configuration file</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$mode</span><span class="var-description">: optional environment profile</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$config_filename</span>			</li>
				</ul>
		
			
	</div>
<a name="methoddefineEntities" id="defineEntities"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">defineEntities</span> (line <span class="line-number">170</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Customizes entities file with prefix based upon server name, project,  or application.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			defineEntities
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$master</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$mode</span> = <span class="var-default">NULL</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$config_filename</span> = <span class="var-default">'entities.xml'</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$master</span><span class="var-description">: app entities skeleton</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$mode</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$config_filename</span><span class="var-description">: optional environment profile</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetCompilePath" id="getCompilePath"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getCompilePath</span> (line <span class="line-number">207</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the path to the compile directory</p>
	<ul class="tags">
				<li><span class="field">return:</span> path to sitemap</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getCompilePath
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetSitemapPath" id="getSitemapPath"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getSitemapPath</span> (line <span class="line-number">194</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the path to the sitemap  Useful for checking the mod time for required rebuilds</p>
	<ul class="tags">
				<li><span class="field">return:</span> path to sitemap</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getSitemapPath
		</span>
				()
			</div>
	
		
			
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Thu, 02 Aug 2007 17:35:18 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.2</a>
	</p>
	</div></body>
</html>